﻿@using DotNetClub.Core.Entity
@model List<Topic>

@if (Model.Count > 0)
{
    foreach (var topic in Model)
    {
        <div class="cell">
            <a class="pull-left" asp-action="Index" asp-controller="User" asp-route-userName="@topic.CreateUser.UserName">
                <useravatar email="@topic.CreateUser.Email" title="@topic.CreateUser.UserName" size="28"></useravatar>
            </a>

            <span class="text-muted pull-left reply-count">
                <span class="text-info">@topic.ReplyCount</span>
                <span class="text-muted reply-seperator">/</span>
                <small class="text-muted">@topic.VisitCount</small>
            </span>

            <a class="pull-right last-reply text-muted" asp-action="Index" asp-controller="Topic" asp-route-id="@topic.ID" asp-fragment="@(topic.LastReplyUserID.HasValue ? "latest" : "")">
                <visible condition="topic.LastReplyUserID.HasValue">
                    <useravatar title="@topic.LastReplyUser.UserName" size="18" email="@topic.LastReplyUser.Email"></useravatar>
                </visible>

                <small>
                    <datetime date="@topic.CreateDate"></datetime>
                </small>
            </a>

            <div class="text-nowrap topic-title-wrapper">
                <a asp-action="Index" asp-controller="Topic" asp-route-id="@topic.ID" class="topic-title">@topic.Title</a>
            </div>
        </div>
    }
}
else
{
    <div class="cell">无</div>
}